<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Class simulate And operator
 *
 * @author bthiep
 * @Email bthiep@lhv.vn
 */
class AndSpecification implements ISpecification {
    private  $spec;
    private $andSpec;
    
    public function __construct(Specification $spec,Specification $andSpec) {
        $this->spec =$spec;
        $this->andSpec = $andSpec;
    }
    public function isSatistifiedBy($expenses) {
        return ($this->spec->isSatistifiedBy($expenses) &&   $this->andSpec->isSatistifiedBy($expenses));
    }
}
